<extend name="Public/base" />

<block name="content">
<div id="content">
	<div id="content-header">
		<div id="breadcrumb">
			<a href="{:U('Index/index')}" title="首页" class="tip-bottom"><i
				class="icon-home"></i> 首页</a> <a class="current">{$meta_title}</a>
		</div>
	</div>
	<div class="container-fluid">
		<br>
		<div class="row-fluid">
			<div class="span12">
				<div class="widget-box">
					<div class="widget-content ">
						<form id="form" action="{:U('import')}" method="post" class="form-horizontal">
							<!-- 基础文档模型 -->
							<div id="tab1" class="tab-pane in tab1">
								<div class="form-item cf">
									<label class="item-label">导入的内容<span class="check-tips">（请按照导入格式输入）</span></label>
										<label class="textarea input-large">
											<textarea name="tree" style="height:100px;"></textarea>
										</label>
									<span class="help-block blue">导入格式：标题|url(回车键)</span>
								</div>
							</div>
							<div class="form-actions">
								<button class="btn submit-btn btn-success" id="submit" type="button">确 定</button>&nbsp;<button class="btn btn-danger" type="button" onclick="javascript:location.href='{$back_url}'">返 回</button>
								<input type="hidden" name="pid" value="{$pid}"/>
								<input type="hidden" name="cate_id" value="{$cate_id|default=0}">
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
$(function(){
	$("#submit").click(function(){
		//锁定提交按钮
		$(this).attr('disabled',true);
		var self = $('form');
		$.post("{:U('import')}", self.serialize(), call_back, "json");
		return false;
		/**
		 * @todo 接收登录返回值
		 */
		function call_back(data){
			if(data.status == 1){
				tke_alert(data.info,'alert-success');
				setTimeout(function(){
					window.location.href = data.url;
				},1000);
			} else {
				tke_alert(data.info,'alert-error');
				$("#submit").attr('disabled',false);
			}
		}
	});
});
//左侧导航高亮
highlight_subnav("{:U('Menu/index')}");
</script>
</block>